/*
 * Created on 03.06.2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package ua.org.sovic.common;

/**
 * @author sovic
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class MathUtil {

	public static double round(double value, int decimalPlace) {
	    double power_of_ten = 1;
	    while (decimalPlace-- > 0) {
                power_of_ten *= 10.0;
            }
	    return Math.round(value * power_of_ten) / power_of_ten;
	}
	public static float round(float value, int decimalPlace) {
	    float power_of_ten = 1;
	    while (decimalPlace-- > 0) {
                power_of_ten *= 10.0;
            }
	    return Math.round(value * power_of_ten) / power_of_ten;
	}
}
